package com.longcheer.weibo.util;

import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;

public class DBUtils {
    
    public static void closeQuietly(SQLiteDatabase db) {
        if (db != null) {
            try {
                db.close();
            } catch (SQLException e) {
                // ignore
            }
        }
    }
    
    public static void closeQuietly(SQLiteDatabase db, Cursor cursor) {
        if (cursor != null) {
            try {
                cursor.close();
            } catch (SQLException e) {
                // ignore
            }
        }
        
        closeQuietly(db);
    }
}
